Near-infrared spectrometer